﻿using System.Configuration;

namespace MammothMicro.SmtpGuardFilter.Configuration
{
    public class ServerSettings : ConfigurationSection
    {
        [ConfigurationProperty("defaultValue", IsRequired = true)]
        public string DefaultValue
        {
            get { return (string)this["defaultValue"]; }
            set { this["defaultValue"] = value; }
        }

        [ConfigurationProperty("ListnerPort", IsRequired = true, DefaultValue = 25)]
        public int ListnerPort
        {
            get { return (int)this["ListnerPort"]; }
            set { this["ListnerPort"] = value; }
        }

        [ConfigurationProperty("ListnerIp", IsRequired = true)]
        public string ListnerIp
        {
            get { return (string)base["ListnerIp"]; }
            set { base["ListnerIp"] = value; }
        }

        [ConfigurationProperty("OutPort", IsRequired = true)]
        public int OutPort
        {
            get { return (int)base["OutPort"]; }
            set { base["OutPort"] = value; }
        }

        [ConfigurationProperty("OutIp", IsRequired = true)]
        public string OutIp
        {
            get { return (string)base["OutIp"]; }
            set { base["OutIp"] = value; }
        }

        [ConfigurationProperty("MxLookup", IsRequired = true)]
        public bool MxLookup
        {
            get { return (bool)base["MxLookup"]; }
            set { base["MxLookup"] = value; }
        }

        [ConfigurationProperty("ReverseLookup", IsRequired = true)]
        public bool ReverseLookup
        {
            get { return (bool)base["ReverseLookup"]; }
            set { base["ReverseLookup"] = value; }
        }

        [ConfigurationProperty("CacheReloadFrequency", IsRequired = true)]
        public int CacheReloadFrequency
        {
            get { return (int)base["CacheReloadFrequency"]; }
            set { base["CacheReloadFrequency"] = value; }
        }

        [ConfigurationProperty("MaxThreads", IsRequired = true)]
        public int MaxThreads
        {
            get { return (int)base["MaxThreads"]; }
            set { base["MaxThreads"] = value; }
        }

        [ConfigurationProperty("BlockNullSender", IsRequired = true)]
        public bool BlockNullSender
        {
            get { return (bool)base["BlockNullSender"]; }
            set { base["BlockNullSender"] = value; }
        }

        [ConfigurationProperty("BlockNullSubject", IsRequired = true)]
        public bool BlockNullSubject
        {
            get { return (bool)base["BlockNullSubject"]; }
            set { base["BlockNullSubject"] = value; }
        }

        [ConfigurationProperty("WelcomeMessage", IsRequired = true)]
        public string WelcomeMessage
        {
            get { return (string)base["WelcomeMessage"]; }
            set { base["WelcomeMessage"] = value; }
        }

        [ConfigurationProperty("Domain", IsRequired = true)]
        public string Domain
        {
            get { return (string)base["Domain"]; }
            set { base["Domain"] = value; }
        }

        [ConfigurationProperty("MessageSpoolDirectory", IsRequired=true ,DefaultValue = "")]
        public string MessageSpoolDirectory
        {
            get { return (string)base["MessageSpoolDirectory"]; }
            set { base["MessageSpoolDirectory"] = value; }
        }

        [ConfigurationProperty("ThreadMaxTime", IsRequired = true)]
        public int ThreadMaxTime
        {
            get { return (int)base["ThreadMaxTime"]; }
            set { base["ThreadMaxTime"] = value; }
        }

        /// <summary>
        /// Maximum message size in MB
        /// Recommended 10MB
        /// </summary>
        [ConfigurationProperty("MaxMessageSize", IsRequired = true)]
        public int MaxMessageSize
        {
            get { return (int)base["MaxMessageSize"]; }
            set { base["MaxMessageSize"] = value; }
        }

        [ConfigurationProperty("CheckRbl", IsRequired = true)]
        public bool CheckRbl
        {
            get { return (bool)base["CheckRbl"]; }
            set { base["CheckRbl"] = value; }
        }

        [ConfigurationProperty("UseSpamAssasin", IsRequired = true)]
        public bool UseSpamAssasin
        {
            get { return (bool)base["UseSpamAssasin"]; }
            set { base["UseSpamAssasin"] = value; }
        }

        [ConfigurationProperty("UseClamWin", IsRequired = true)]
        public bool UseClamWin
        {
            get { return (bool)base["UseClamWin"]; }
            set { base["UseClamWin"] = value; }
        }



    }
}